﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2022 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Base;

/// <summary>
/// 授权菜单
/// </summary>
[SuppressSniffer, AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class, AllowMultiple = true)]
public sealed class AuthorityControllerAttribute : Attribute
{
    /// <summary>
    /// 权限控制器
    /// </summary>
    /// <param name="area">权限类型代码(Admin、API、API2)</param>
    /// <param name="controller">控制器</param>
    /// <param name="controllerDescription">控制器描述符</param>
    public AuthorityControllerAttribute(string area = "HtAdmin", string controller = "", string controllerDescription = "")
    {
        Area = area;
        ControllerDescription = controllerDescription;
        Controller = controller;
    }

    /// <summary>
    /// 权限类型代码
    /// </summary>
    public string Area { get; set; } = "HtAdmin";

    /// <summary>
    /// 控制器（默认为当前的 Controller,如果手动设置，则为手动设置）
    /// </summary>
    public string Controller { get; }

    /// <summary>
    /// Controller 名称
    /// </summary>
    public string ControllerDescription { get; set; }

    /// <summary>
    /// 父Id
    /// </summary>
    public string PCode { get; set; }
}